<%--
  Created by IntelliJ IDEA.
  User: 17214
  Date: 2022/8/25
  Time: 10:30
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>会员信息</title>
    <link type="text/css" rel="stylesheet"
          href="${pageContext.request.contextPath}/admin/car/fontsawesome/css/font-awesome.css"/>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/admin/car/css/style.css"/>
</head>
<body>
<div class="main_box">
    <h2><span></span>会员信息</h2>
    <div class="search_box clearfix">
        <label class="f_left">搜索会员：</label>
        <form action="${pageContext.request.contextPath}/hyxx/findhyid" method="get">
            <input type="search" placeholder="请输入手机号/车牌号/姓名" class="f_left search_input" id="ssuo" name="cxtj"
                   value="${byId.c_name}"/>
            <input type="submit" value="搜索" class="btn blue_btn"/>
        </form>
    </div>
    <div class="cont_box">
        <ul class="tab_tit clearfix">
            <li>会员基本信息</li>
            <li>爱车</li>
            <li>储值卡</li>
            <li>年卡</li>
            <li>大礼包</li>
            <li>消费记录</li>
            <li>积分记录</li>
        </ul>
        <dl class="tab_conbox">
            <!--会员基本信息-->
            <dd>
                <form action="${pageContext.request.contextPath}/hyxx/updateUser" method="post" id="edit_user">
                    <div class="addpro_box clearfix">
                        <label>姓名：</label>
                        <input type="text" value="${byId.c_name}" name="c_name" required data-rule-fullname="true"
                               data-msg-required="会员姓名不能为空"/>
                    </div>
                    <div class="addpro_box clearfix">
                        <label>手机号：</label>
                        <input type="text" value="${byId.c_phone}" name="c_phone" required data-rule-mobile="true"
                               data-msg-required="会员手机号不能为空"/>
                    </div>
                    <div class="addpro_box clearfix">
                        <label>所属门店：</label>
                        <input type="text" name="l_dianpu" value="${byId.l_dianpu}"/>
                    </div>
                    <div class="addpro_box learfix">
                        <label>注册来源：</label>
                        <input type="text" name="c_zhucefs" value="${byId.c_zhucefs}"/>
                    </div>
                    <div class="probtn_box clearfix">
                        <input type="submit" value="保存修改" class="btn blue_btn">
                    </div>
                </form>
            </dd>
            <!--爱车-->
            <dd>
                <div class="margin_tb clearfix">
                    <a href="${pageContext.request.contextPath}/admin/car/add_Car.jsp">
                        <button class="btn blue_btn">添加爱车</button>
                    </a>
                </div>
                <!--爱车信息-->
                <C:forEach items="${car}" var="list">
                    <div class="ucar_list">
                        <h5>
                            <span>${list.c_carnumber}</span>
                            <a href="${pageContext.request.contextPath}/hyxx/findOneCar/${list.c_ipnumber}"
                               class="edit_car">编辑车辆信息</a>
                            <a href="${pageContext.request.contextPath}/hyxx/delCar/${list.c_carnumber}">删除车辆</a>
                        </h5>
                        <table border="0" cellspacing="0" cellpadding="0" class="table">
                            <tbody>
                            <tr>
                                <td>品牌</td>
                                <td>${list.c_carname}</td>
                                <td>系列</td>
                                <td>${list.c_model}</td>
                            </tr>
                            <tr>
                                <td>型号</td>
                                <td>${list.c_fnumber}</td>
                                <td>发动机号</td>
                                <td>${list.c_enumber}</td>
                            </tr>
                            <tr>
                                <td>车牌号</td>
                                <td>${list.c_ipnumber}</td>
                                <td>车架号</td>
                                <td>${list.c_series}</td>
                            </tr>
                            <tr>
                                <td>行驶证</td>
                                <td>${list.c_dlicense}</td>
                                <td>年份</td>
                                <td>${list.c_year}</td>
                            </tr>
                            <tr>
                                <td>指导价</td>
                                <td>${list.c_price}</td>
                                <td>保险到期日</td>
                                <td>${list.c_iedate}</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </C:forEach>
            </dd>
            <!--储值卡-->
            <dd>
                <!--当前储值卡为空时显示添加按钮-->
                <div class="margin_tb clearfix">
                    <a href="${pageContext.request.contextPath}/hyxx/findxs">
                        <button class="btn blue_btn">添加储值卡</button>
                    </a>
                </div>
                <table border="0" cellspacing="0" cellpadding="0" class="table">
                    <thead>
                    <tr>
                        <th>用户手机号</th>
                        <th>卡片ID</th>
                        <th>卡片种类</th>
                        <th>卡片余额</th>
                        <th>卡片折扣</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <C:forEach items="${card}" var="card">
                        <tr id="123"><!--这里id为卡片操作时需要-->
                            <td>${card.c_phone}</td>
                            <td>${card.card_id}</td>
                            <td>${card.card_chuzhi}</td>
                            <td>${card.c_yu}</td>
                            <td>${card.c_zk}</td>
                            <td>
                                <a href="${pageContext.request.contextPath}/hyxx/cardsj?c_phone=${card.c_phone}" class="table_btn table_edit">
                                    <i class="fa fa-thumbs-up"></i>
                                    <span>卡片升级</span>
                                </a>
                                <a href="${pageContext.request.contextPath}/hyxx/cardcz" class="table_btn table_info">
                                    <i class="fa fa-mail-forward"></i>
                                    <span>卡片充值</span>
                                </a>
                                <a href="${pageContext.request.contextPath}/hyxx/" class="table_btn table_del">
                                    <i class="fa fa-trash-o"></i>
                                    <span>删除卡片</span>
                                </a>
                            </td>
                        </tr>
                    </C:forEach>
                    </tbody>
                </table>
            </dd>
            <!--年卡-->
            <dd>
                <!--当前年为空时显示添加按钮-->
                <div class="margin_tb clearfix">
                    <a href="${pageContext.request.contextPath}/hyxx/nianxs"><button type="button" class="btn blue_btn">添加年卡</button></a>
                </div>
                <table border="0" cellspacing="0" cellpadding="0" class="table">
                    <thead>
                    <tr>
                        <th>用户手机号</th>
                        <th>用户姓名</th>
                        <th>卡片额度</th>
                        <th>绑定车牌号</th>
                        <th>办理日期</th>
                        <th>过期日期</th>
                        <th>状态</th>
                    </tr>
                    </thead>
                    <tbody>
                    <C:forEach items="${nian}" var="nian">
                    <tr>
                        <td>${nian.c_phone}</td>
                        <td>${nian.c_name}</td>
                        <td>${nian.nian_money}</td>
                        <td>${nian.c_ipnumber}</td>
                        <td>${nian.year_card_starttime}</td>
                        <td>${nian.year_card_endtime}</td>
                        <td>${nian.year_card_zhuangtai}</td>
                    </tr>
                    </C:forEach>
                    </tbody>
                </table>
            </dd>
            <!--大礼包-->
            <dd>
                <div class="margin_tb clearfix">
                    <a href="${pageContext.request.contextPath}/hyxx/lbtz?c_phone=${byId.c_phone}"><button type="button" class="btn blue_btn">添加大礼包</button></a>
                </div>
                <table border="0" cellspacing="0" cellpadding="0" class="table">
                    <thead>
                    <tr>
                        <th>用户手机号</th>
                        <th>大礼包</th>
                        <th>大礼包价格</th>
                        <th>办理日期</th>
                        <th>过期日期</th>
                        <th>大礼包详情</th>
                    </tr>
                    </thead>
                    <tbody>
                        <c:forEach items="${lb}" var="lb">
                    <tr>
                        <td>${lb.c_phone}</td>
                        <td>${lb.l_Gift_bag_name}</td>
                        <td>${lb.l_money}</td>
                        <td>${lb.l_startdate}</td>
                        <td>${lb.l_enddate}</td>
                        <td>${lb.l_Gift_pack_service}</td>
                    </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </dd>
            <!--消费记录-->
            <dd>
                <table border="0" cellspacing="0" cellpadding="0" class="table">
                    <thead>
                    <tr>
                        <th>订单号</th>
                        <th>消费金额</th>
                        <th>会员</th>
                        <th>手机号</th>
                        <th>支付</th>
                        <th>状态</th>
                        <th>开单日期</th>
                        <th>订单备注</th>
                        <th>所属门店</th>
                    </tr>
                    </thead>
                    <tbody>
                    <C:forEach items="${list}" var="list">
                        <tr>
                            <td>${list.e_order_number}</td>
                            <td>${list.e_money}</td>
                            <td>${list.e_meber_name}</td>
                            <td>${list.e_phone}</td>
                            <td>${list.e_Payment_method}</td>
                            <td>${list.e_state}</td>
                            <td>${list.e_Billig_date}</td>
                            <td>${list.e_order_remarks}</td>
                            <td>${list.c_dianpu}</td>
                        </tr>
                    </C:forEach>
                    </tbody>
                </table>
            </dd>
            <!--积分记录-->
            <dd>
                <table border="0" cellspacing="0" cellpadding="0" class="table">
                    <thead>
                    <tr>
                        <th>会员</th>
                        <th>手机号</th>
                        <th>原积分</th>
                        <th>状态</th>
                        <th>积分变动</th>
                        <th>当前积分</th>
                        <th>操作类型</th>
                        <th>操作日期</th>
                    </tr>
                    </thead>
                    <tbody>
                    <C:forEach items="${jifenlist}" var="list">
                        <tr>
                            <td>${list.c_name}</td>
                            <td>${list.c_phone}</td>
                            <td>${list.m_primary}</td>
                            <td>${list.m_state}</td>
                            <td>${list.m_integral_change}</td>
                            <td>${list.m_current}</td>
                            <td>${list.m_Operation_type}</td>
                            <td>${list.m_Operation_date}</td>
                        </tr>
                    </C:forEach>
                    </tbody>
                </table>
            </dd>
        </dl>
    </div>
</div>
<!--javascript include-->
<script src="${pageContext.request.contextPath}/admin/car/js/jquery-2.2.1.min.js"></script>
<script src="${pageContext.request.contextPath}/admin/car/js/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/admin/car/js/bootstrap-datepicker.js"></script>
<script src="${pageContext.request.contextPath}/admin/car/js/jquery.validate.min.js"></script>
<script src="${pageContext.request.contextPath}/admin/car/js/other.js"></script>
<script>
    $(function () {
        $.jqtab(".tab_tit", ".tab_conbox", "click");
        var addCar = "${byId.c_membernumber}",//添加爱车时所需id
            editCar = "${byId.c_membernumber}",//添加爱车时所需id
            delCar = "${byId.c_membernumber}",//添加爱车时所需id
            addYcard = "${byId.c_membernumber}",//添加爱车时所需id
            addSpree = "${byId.c_membernumber}",//添加爱车时所需id
            addPcard = "${byId.c_membernumber}",//添加爱车时所需id
            delPcard = "${byId.c_membernumber}";//添加爱车时所需id
        $("body").other({formId: "#edit_user", formUrl: "#"});//formUrl 表单请求地址,linkHref 请求成功后跳转地址，此页面不需要，已删除
        $("body").tipWindow({
            method: "edit",
            type: "form",
            Class: ".add_car",
            even: "click",
            dataId: addCar,
            tipTit: "添加爱车",
            Twidth: "700",
            Theight: "520",
            editUrl: "${pageContext.request.contextPath}/admin/car/add_Car.jsp"
        });//editUrl 添加爱车请求地址
        $("body").tipWindow({
            method: "edit",
            type: "form",
            Class: ".edit_car",
            even: "click",
            dataId: editCar,
            tipTit: "编辑爱车",
            Twidth: "700",
            Theight: "520",
            editUrl: "${pageContext.request.contextPath}/admin/car/edit_Car.jsp"
        });//editUrl 编辑爱车请求地址
        $("body").tipWindow({
            method: "delete",
            Class: ".del_car",
            even: "click",
            dataId: delCar,
            Twidth: "400",
            Theight: "180",
            delUrl: "${pageContext.request.contextPath}/hyxx/delCar"
        });//delUrl 删除爱车请求地址
        $("body").tipWindow({
            method: "edit",
            type: "form",
            Class: ".add_ycard",
            even: "click",
            dataId: addYcard,
            tipTit: "添加年卡",
            Twidth: "600",
            Theight: "400",
            editUrl: "add_Ycard.html"
        });//editUrl 添加年卡请求地址
        $("body").tipWindow({
            method: "edit",
            type: "form",
            Class: ".add_spree",
            even: "click",
            dataId: addSpree,
            tipTit: "添加大礼包",
            Twidth: "600",
            Theight: "520",
            editUrl: "add_Spree.html"
        });//editUrl 添加大礼包请求地址
        $("body").tipWindow({
            method: "edit",
            type: "form",
            Class: ".add_pcard",
            even: "click",
            dataId: addPcard,
            tipTit: "添加储值卡",
            Twidth: "600",
            Theight: "400",
            editUrl: "add_Pcard.html"
        });//editUrl 添加储值卡请求地址
        $("body").tipWindow({
            method: "delete",
            Class: ".del_btn",
            even: "click",
            Twidth: "400",
            dataId: delPcard,
            Theight: "180",
            delUrl: "#"
        });//delUrl 删除储值卡请求地址
        $("body").tipWindow({
            method: "edit",
            type: "form",
            Class: ".upgrade_btn",
            even: "click",
            tipTit: "储值卡升级",
            Twidth: "600",
            Theight: "360",
            editUrl: "pcard_Upgrade.html"
        });//editUrl 储值卡升级请求地址
        $("body").tipWindow({
            method: "edit",
            type: "form",
            Class: ".recharge_btn",
            even: "click",
            tipTit: "储值卡充值",
            Twidth: "600",
            Theight: "300",
            editUrl: "pcard_Recharge.html"
        });//editUrl 储值卡充值请求地址
        //查询会员获取信息
        var hyid = "";//会员id
        <%--$(".search").click(function(){--%>
        <%--    $.ajax({--%>
        <%--        type:"post",--%>
        <%--        url:"${pageContext.request.contextPath}/hyxx/findhyid",--%>
        <%--        data:{"hyid":hyid,"cxtj":$("#ssuo").val()},--%>
        <%--        success:function(data){--%>
        <%--            hyid=data;--%>
        <%--            $("#d1").html(data.data)--%>
        <%--        },--%>
        <%--        error:function(data){--%>
        <%--            alert("查询失败，请重试！");--%>
        <%--        }--%>
        <%--    });--%>
        <%--});--%>

    });
</script>
</body>
</html>
